package com.handersome;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

import com.handersome.db.service.SchoolService;
import com.handersome.util.SpringContextHolder;

/**
 * spring boot 项目启动的入口
 * @author handersome
 *
 * @version 创建时间：2017年11月30日 下午5:21:47
 */
@SpringBootApplication
public class Application {
	
	private static final Logger logger = LoggerFactory.getLogger(Application.class);

	public static void main(String[] args){
		SpringApplication.run(Application.class, args);
		logger.info("------------------服务器正在启动---------------");
		SchoolService ss = SpringContextHolder.getBean(SchoolService.class);
		logger.info("第一次");
		ss.findAll();
		logger.info("第二次");
		ss.findAll();
		logger.info("第三次");
		try {
			Thread.sleep(3000);
			ss.findAll();
		} catch (InterruptedException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
}
